﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.OleDb;
using ANZ_AIM_DAL;

namespace ANZ_AIM_BLL
{
    public class RoleBLL
    {
        private string ConnectionString;
        private const string TABLE_NAME = "Roles";

        public RoleBLL()
        {
            ConnectionString = DBHelper.GetMainMdbConnectionString();
        }

        public DataTable GetRoles()
        {
            try
            {
                string command = string.Format("SELECT RoleID, RoleName FROM {0} WHERE IsActive = true", TABLE_NAME);
                DataSet dsResult = OleDbHelper.ExecuteDataset(this.ConnectionString, CommandType.Text, command);
                return dsResult.Tables[0];
            }
            catch (Exception ex) { throw; }
        }
    }
}
